home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mebbs / logtossv101.lha / logtoss.rexx < prev    next >
OS/2 REXX Batch file  |  1995-02-22  |  3KB  |  112 lines

  1. /*Yet another Spiffy Arexx Program from the one and only "Joe Clayton" */
  2. option results
  3. aa=0
  4. call open(f1,'mebbsnet:configfiles/logtoss.cfg','r')
  5. do until aa=11
  6. aa=aa+1
  7. d1.aa=upper(readln(f1))
  8. end
  9. call close(f1)
  10. address command'list 'd1.5'#?.log lformat %s >ram:logtoss.tmp'
  11. call open(loglist,'ram:logtoss.tmp','r')
  12. ab=0
  13. do while eof(loglist)='0'
  14. ab=ab+1
  15. FILE.ab=readln(loglist)
  16. if file.ab~='' then do
  17. call output
  18. address command'move 'd1.5||FILE.ab' TO 'd1.6||d2.1'_'d2.2'_'d2.3'_'d2.4''
  19. end
  20. end
  21. call close(loglist)
  22. address command"delete ram:logtoss.tmp"
  23. call inse
  24. call open(t1,"mebbsnet:Call.log",'w')
  25. call close(t1)
  26. call open(t1,"mebbsnet:Upload.log",'w')
  27. call close(t1)
  28. call open(t1,"mebbsnet:DownLoad.log",'w')
  29. call close(t1)
  30. exit 0
  31. Output:
  32. if d1.1='YEAR' then do
  33. d2.1=left(date(s),4);VAR.1='YDAT';end
  34. if d1.1='MONTH' then do
  35. d2.1=left(date(u),2);VAR.1='MDAT';end
  36. if d1.1='DAY' then do
  37. d2.1=right(date(s),2);VAR.1='DDAT';end
  38. if d1.1='FILE' then do
  39. d2.1=FILE.ab;VAR.1='FDAT';end
  40. if d1.2='YEAR' then do
  41. d2.2=left(date(s),4);VAR.2='YDAT';end
  42. if d1.2='MONTH' then do
  43. d2.2=left(date(u),2);VAR.2='MDAT';end
  44. if d1.2='DAY' then do
  45. d2.2=right(date(s),2);VAR.2='DDAT';end
  46. if d1.2='FILE' then do
  47. d2.2=FILE.ab;VAR.2='FDAT';end
  48. if d1.3='YEAR' then do
  49. d2.3=left(date(s),4);VAR.3='YDAT';end
  50. if d1.3='MONTH' then do
  51. d2.3=left(date(u),2);VAR.3='MDAT';end
  52. if d1.3='DAY' then do
  53. d2.3=right(date(s),2);VAR.3='DDAT';end
  54. if d1.3='FILE' then do
  55. d2.3=FILE.ab;VAR.3='FDAT';end
  56. if d1.4='YEAR' then do
  57. d2.4=left(date(s),4);VAR.4='YDAT';end
  58. if d1.4='MONTH' then do
  59. d2.4=left(date(u),2);VAR.4='MDAT';end
  60. if d1.4='DAY' then do
  61. d2.4=right(date(s),2);VAR.4='DDAT';end
  62. if d1.4='FILE' then do
  63. d2.4=FILE.ab;VAR.4='FDAT';end
  64. return
  65. inse:
  66. if datatype(d1.11,"w")="1" then call killlog
  67. return
  68. KillLog:
  69. address command'list 'd1.6'#?_#? lformat %s >ram:logtoss.tmp'
  70. call open(kill,'ram:logtoss.tmp','r')
  71. ac=0
  72. do while eof(kill)='0'
  73. ac=ac+1
  74. data.ac=readln(kill)
  75. if data.ac~='' then do
  76. parse var data.ac var1'_'var2'_'var3'_'var4
  77. call killout
  78. end
  79. end
  80. call close(kill)
  81. address command"Delete ram:logtoss.tmp"
  82. return
  83. killout:
  84. ad=0
  85. if var.1='YDAT' then DAT1=var1*0
  86. if var.1='MDAT' then DAT1=var1*30
  87. if var.1='DDAT' then DAT1=var1
  88. if var.1='FDAT' then DAT1=var1
  89. if var.2='YDAT' then DAT2=var2*0
  90. if var.2='MDAT' then DAT2=var2*30
  91. if var.2='DDAT' then DAT2=var2
  92. if var.2='FDAT' then DAT2=var2
  93. if var.3='YDAT' then DAT3=var3*0
  94. if var.3='MDAT' then DAT3=var3*30
  95. if var.3='DDAT' then DAT3=var3
  96. if var.3='FDAT' then DAT3=var3
  97. if var.4='YDAT' then DAT4=var4*0
  98. if var.4='MDAT' then DAT4=var4*30
  99. if var.4='DDAT' then DAT4=var4
  100. if var.4='FDAT' then DAT4=var4
  101. if datatype(dat1,'w')='1' then ad=ad+dat1
  102. if datatype(dat2,'w')='1' then ad=ad+dat2
  103. if datatype(dat3,'w')='1' then ad=ad+dat3
  104. if datatype(dat4,'w')='1' then ad=ad+dat4
  105. mx=left(date(u),2)*30
  106. nx=right(date(s),2)
  107. datest=nx+mx
  108. if ad+d1.11<datest then do
  109. address command"Delete "d1.6||data.ac
  110. end
  111. return
  112.